<template>
	<el-dialog :title="titleMap[mode]" v-model="visible" width="55%" destroy-on-close @closed="$emit('closed')" align-center>
        <scTable ref="table" :data="tableData" stripe remoteSort remoteFilter border hideDo hidePagination height="450">
            <el-table-column label="缸号" prop="batch_no" align="center"></el-table-column>
            <el-table-column label="仓库" prop="ware_name" align="center"></el-table-column>
            <el-table-column label="库存数量" prop="curr_stock" align="center"></el-table-column>
            <el-table-column label="末次入库" prop="last_put_date" align="center"></el-table-column>
            <el-table-column label="末次出库" prop="last_out_date" align="center"></el-table-column>
        </scTable>
		<template #footer>
			<el-button @click="visible = false">取 消</el-button>
		</template>
	</el-dialog>
</template>

<script>
export default {
	emits: ['success', 'closed'],
	data() {
		return {
			mode: "add",
			titleMap: {
				add: '查看批次信息',
				edit: '编辑仓库',
				show: '查看'
			},
			visible: false,
			isSaveing: false,
            tableData:[],
		}
	},
	mounted() {
	},
	methods: {
		//显示
		open(mode = 'add') {
			this.mode = mode;
			this.visible = true;
			return this
		},
		//表单注入数据
		async setData(data) {
            let reqData = {
                material_spec_code:data.material_spec_code,
                warehouse_id:data.warehouse_id
            }
            var res = await this.$API.inventory.getBatch.get(reqData);
            this.tableData = res.data
		}
	}
}
</script>

<style></style>
